-
Notifications
You must be signed in to change notification settings - Fork 18.4k
feat(core): update graph_mermaid.py #31577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Correct the `_escape_node_label` method to be compatible with multilingual title names
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
CodSpeed WallTime Performance ReportMerging #31577 will not alter performanceComparing
|
CodSpeed Instrumentation Performance ReportMerging #31577 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be worried about removing all non-alphanumerics (including Unicode) but since this is scoped to mermaid and private it LGTM. cc: @eyurtsev for final approval
This pull request includes a refinement to the
_escape_node_label
function inlibs/core/langchain_core/runnables/graph_mermaid.py
. The change improves the handling of special characters in Mermaid syntax by expanding the regex pattern to include additional characters.Key change:
libs/core/langchain_core/runnables/graph_mermaid.py
: Updated the_escape_node_label
function to use a more comprehensive regex pattern (mermaid_special_chars
) for escaping special characters in Mermaid syntax. This ensures better compatibility and avoids issues with unsupported characters.Correct the_escape_node_label
method to be compatible with multilingual title names